package com.xuhuan.juc.lambda;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author huan.xu
 * @Date 2021/12/28 16:09
 * @Description lambda表达式
 */
@Slf4j
public class LambdaExpressDemo {

    public static void main(String[] args) {
        Foo foo = (x, y) -> {
            return x + y;
        };
        foo.add(1, 2);
        Foo.div(10,2);
        Foo.div2(10,2);
    }
}

@FunctionalInterface
interface Foo {
    public int add(int x, int y);

    public static int div(int x, int y) {
        return x / y;
    }

    public static int div2(int x, int y) {
        return x / y;
    }
}